package java_IfAndSwitch.demo3;

/**
 * switch匹配字符串
 */
public class Test3 {
    public static void main(String[] args) {
        whatStr("3");
    }

    public static void whatStr(String str){
        /*
        计算每个字符串的hashCode值，根据hashCode值进行匹配
         */
        switch (str){
            case "1","2","3","4","5":
                System.out.println("工作日");
                break;
            case "6","7":
                System.out.println("休息日");
                break;
            default:
                System.out.println("未知");
        }
    }
}
